package com.eci.context.asset.enums;

public enum OrgTypeEnum {
	
	ROOT("0","根节点"),
	GROUP("1","集团"),
	COMPANY("2","公司"),
	DEPT("3","部门"),
	JOB("4","岗位");
	
	private String key; 
	private String val; 
	
	OrgTypeEnum(String key,String val){
		this.key = key;
		this.val = val;
	}

	public String getKey() {
		return key;
	}

	public String getVal() {
		return val;
	}
	
    public static OrgTypeEnum getByKey(String key) {  
        for(OrgTypeEnum en : OrgTypeEnum.values()){
            if(en.key.equals(key)) {  
                return en;  
            }  
        }  
        throw new IllegalArgumentException("No element matches " + key);  
    }  
	
}
